<?php
namespace app\store\model;
use app\common\model\Comment as CommentModel;

/**
 * 用户评论
 */
class Comment extends CommentModel
{
    /**
     * 编辑
     */
    public function edit($data)
    {
        return $this->allowField(true)->save($data);
    }
	
    /**
     * 删除
     */
    public function remove()
    {
		//删除评论图片
		if($this->img['value']==1){
			//删除本地图片
			if(file_exists($this->img['url']))
			{
				unlink($this->img['url']);
			}
		}
        return $this->delete();
    }
}
